package com.sl.rest.feign;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class UserFeignClientFallBackFactory implements FallbackFactory<UserFeignClient>{
    @Override
    public UserFeignClient create(Throwable throwable) {
        log.error("快速失败",throwable);
        return new UserFeignClient() {
            @Override
            public String getName() {
                return "默认";
            }
        };
    }
}
